package com.example.home_app.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import java.util.*


/**
 *
 * @author dell
 * @date 2021/7/20
 */
class Equipment(
    fm: FragmentManager?, private val mFragments: ArrayList<Fragment>, //导航的标题
    private val mTitle: List<String>
) :
    FragmentPagerAdapter(fm !!) {
    override fun getItem(position: Int): Fragment {
        return mFragments[position]
    }

    override fun getCount(): Int {
        return mFragments.size
    }
    /**
     * 这里设置对应于XTabLayout的标签名。
     *
     * @param position
     * @return
     */
    override fun getPageTitle(position: Int): CharSequence {
        return mTitle[position]
    }
}